home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / telecom / 146 / gfa / reversec.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-17  |  427 b   |  23 lines

  1. /*****************************************************************************
  2. *
  3. * reverse string function 
  4. * For interface with GFA Basic 
  5. * Compiled with Alcyon compiler
  6. *
  7. ******************************************************************************/
  8.  
  9.  
  10. reverse(str,len)
  11. char *str;
  12. int len;
  13. {
  14.  int c,i,j;
  15.  
  16.  for (i=0, j = len-1; i< j; i++, j--)
  17.  {
  18.    c = str[i];
  19.    str[i] = str[j];
  20.    str[j] = c;
  21.   }
  22. }
  23.